package com.zsrt.scott.ch01;

import org.apache.cxf.frontend.ServerFactoryBean;

/**
 * 使用CXF创建ws 基于代码方式
 * ServerFactoryBean:不支持注解
 * @author Administrator
 *
 */
public class CXFWebService {
	
	
	public static void main(String[] args) {
		
		ServerFactoryBean bean = new ServerFactoryBean();
		
		//设置ws的服务地址
		String address= "http://192.168.10.137:8080/cal";
		bean.setAddress(address);
		
		//设置服务的实现类
		bean.setServiceBean(new CalService());
		
		//服务ws服务
		bean.create();
		
		System.out.println(address+"?wsdl");
	}

}
